#include <stdio.h>

#define N 10

int main(void)
{
    printf("请输入%d个成绩:", N);
    int sc, i = 0;
    int max_sc = -1, min_sc = 101;

    while (i < N) {
        scanf("%d", &sc);
        if (!(sc >= 0 && sc <= 100)) {
            printf("数据不合法！请重新输入：\n");
            continue;
        }
        max_sc = max_sc > sc ? max_sc : sc;
        min_sc = min_sc < sc ? min_sc : sc;
        i++;
    }
    printf("最高分和最低分的差值：%d\n", max_sc - min_sc);
    return 0;
}


